import 'package:fsharing/core/models/cart_list.dart';
import 'package:fsharing/core/models/product_detail.dart';
import 'package:json_annotation/json_annotation.dart';

part 'order_confirm.g.dart';

@JsonSerializable()
class OrderConfirm {
  final Address defaultAddress;
  final List<Store> carts;
  final List<Price> totalPriceVos;
  final Map<String, String> payModes;

  OrderConfirm(this.defaultAddress, this.carts, this.totalPriceVos, this.payModes);

  factory OrderConfirm.fromJson(Map<String, dynamic> json) => _$OrderConfirmFromJson(json);

  Map<String, dynamic> toJson() => _$OrderConfirmToJson(this);
}

@JsonSerializable()
class Address {
  final int id;
  final String linkMan;
  final String contactPhone;
  final String fullAddress;

  Address(
    this.id,
    this.linkMan,
    this.contactPhone,
    this.fullAddress,
  );

  factory Address.fromJson(Map<String, dynamic> json) => _$AddressFromJson(json);

  Map<String, dynamic> toJson() => _$AddressToJson(this);
}

@JsonSerializable()
class County {
  final int id;
  final String name;
  final String fullName;
  final String level;

  County(this.id, this.name, this.fullName, this.level);

  factory County.fromJson(Map<String, dynamic> json) => _$CountyFromJson(json);

  Map<String, dynamic> toJson() => _$CountyToJson(this);
}
